<script>
export default {
	onLaunch: function() {
		console.log('App Launch');
		let userinfo = this.$$.getStorage('userinfo');
		uni.getSystemInfo({
			success: res => {
				console.log(res.windowWidth, res.windowHeight);
				this.$store.commit('setScreenSize', {
					width: res.windowWidth,
					height: res.windowHeight
				});
			}
		});

		// #ifdef APP-PLUS
		// 判断是否存在登录信息
		if (!userinfo) {
			//不存在则跳转登录页
			uni.reLaunch({
				url: '/pages/login/login',
				success: () => {
					//跳转完页面后再关闭启动页
					plus.navigator.closeSplashscreen();
				}
			});
		} else {
			//存在则关闭启动页进入首页
			plus.navigator.closeSplashscreen();
		}

		this.$$.getUpdate(false);
		// #endif
	},
	onShow: function() {
		console.log('App Show');
	},
	onHide: function() {
		console.log('App Hide');
	}
};
</script>

<style lang="scss">
/*每个页面公共css */
//#ifndef APP-NVUE
@import url('./common/iconfont/iconfont.css');
@import url('./common/css/style.scss');
//#endif
.flag{
	color: red!important;
}
</style>
